import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCmsBannersController } from '../../../controllers';
const uctoocmsBannersRouter = new Router();
const cmsBannersController = new uctooCmsBannersController();

uctoocmsBannersRouter.post('/add', requireUser, cmsBannersController.add);
uctoocmsBannersRouter.post('/edit', requireUser, rowLevelPermission('uctoo/cms_banners'), cmsBannersController.edit);
uctoocmsBannersRouter.post('/del', requireUser, rowLevelPermission('uctoo/cms_banners'), cmsBannersController.delete);

//For getting cmsBanners with permission control
uctoocmsBannersRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/cms_banners'), cmsBannersController.getSingle);
uctoocmsBannersRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/cms_banners'), cmsBannersController.getMany);
uctoocmsBannersRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/cms_banners'), cmsBannersController.getMany);

//#endregion AutoCreateCode
export default uctoocmsBannersRouter;
